package exercise;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @classname:DateUtil01
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/10 19:30
 * @version: 0.1
 * @since:1.8
 */
public class DateUtil01 {
    private static final String PATTERN = "yyyy-MM-dd HH:mm:ss";
    public static void main(String[] args) {
        String str = "2020-01-01 12:00:00";

        DateTimeFormatter dateTimeFormatter =  DateTimeFormatter.ofPattern(PATTERN);
        LocalDateTime parse = LocalDateTime.now();
        LocalDateTime parse1 = parse.parse(str, dateTimeFormatter);
        System.out.println(parse1);

        System.out.println(parse);
//        String format = parse.format(PATTERN);

    }
}
